/*
 * TileImage.fx
 *
 * Created on Jul 29, 2009, 4:54:52 PM
 */

package com.gpsbuddy.objects;

import javafx.scene.image.ImageView;

import com.gpsbuddy.utils.TilesUtils;



/**
 * @author jonycus
 */

public class TileImageView extends ImageView {
    public-init var width = 256;
    public-init var height = 256;
    public-init var tileX : Integer;
    public-init var tileY : Integer;
    public-init var zoom : Number;

    //override var layoutX = bind tileX*256-256;
    //override var layoutY = bind tileY*256-256;

    public override var cache = true;

    postinit {
        image = TileImage {
            url: TilesUtils.getTileNumberXY(tileX, tileY, zoom);
            backgroundLoading: true;
        }
        //println(tileX);
        //println(tileY);
        println(image.url);
    }

}
 